// 采用 jquery 的方式封装我们的功能模块，以提高性能(缩短作用域)，防止全局污染
(function (window, document) {
  // 封装选择器
  const getSelector = ele => {
    return typeof ele === "string" ? document.querySelector(ele) : "";
  }
  // 1 登录注册的载入
  window.onload = () => {
    var show = getSelector(".container");
    show.className += " container-show";
  }
  // 2 登录注册切换逻辑
  let toSignBtn = getSelector('.toSign'),
    toLoginBtn = getSelector('.toLogin'),
    loginBox = getSelector('.login-box'),
    signBox = getSelector('.sign-box')

  toSignBtn.onclick = () => {
    loginBox.className += ' animate_login';
    signBox.className += ' animate_sign';
  }

  toLoginBtn.onclick = () => {
    loginBox.classList.remove('animate_login');
    signBox.classList.remove('animate_sign');
  }

})(window, document)